package com.jetpackframework.webview;

import android.os.Bundle;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.frameworkx.layout.activity_webview;
import com.gwm.annotation.bus.LiveMessage;
import com.gwm.annotation.layout.Layout;
import com.gwm.annotation.router.ARouter;
import com.gwm.annotation.router.RouterField;
import com.jetpackframework.R;
import com.jetpackframework.R2;
import com.jetpackframework.base.BaseActivity;
@Layout(R2.layout.activity_webview)
@ARouter("frameworkx/webviewActivity")
public class WebViewActivity extends BaseActivity<activity_webview> {

    @RouterField(value = "url")
    public String url;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.e("TAG","url="+url);
        FragmentManager manager = getSupportFragmentManager();
        FragmentTransaction transaction = manager.beginTransaction();
        transaction.replace(R.id.frame_content,WebViewFragment.newInstance(url));
        transaction.commit();
    }
    @LiveMessage(action = "OpenSystemActivity")
    public void onLiveMessage(Object object){
        Log.e("WebViewActivity","onLiveMessage object:"+object);
    }
}
